{template 'common/header'}
<style>
.sub-search input,.sub-search select{margin-bottom:0;}
</style>
<div class="panel panel-default">
	 <div class="panel-heading">
     	搜索
     </div>
	<form action="" method="get" class="form-horizontal form">
		<div class="panel-body">
			<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">姓名</label>
			<div class="col-sm-9">
				<input class="form-control" name="username" id="" type="text" value="{$_GPC['username']}">
			</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">电话</label>
				<div class="col-sm-9">
					<input class="form-control" name="mobile" id="" type="text" value="{$_GPC['mobile']}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
					<td><input type="submit" name="" value="搜索" class="btn btn-primary" /></td>
			</div>
		</div>
	</form>
</div>
	
<div class="panel panel-default">
	<div class="panel-heading">详细数据  |  总中奖数:{$total} </div>
	<form action="" method="post" onsubmit="">
		<div class="sub-content">
		<table class="table table-hover">
		<thead class="navbar-inner">
			<tr>
				<th style="width:5%;" >编号<i></i></th>
				<th style="width:10%;">姓名<i></i></th>
				<th style="width:15%;">电话<i></i></th>
				<th style="width:15%;">奖项<i></i></th>
				<th style="width:15%;">奖品<i></i></th>
				<th style="width:20%;">中奖时间<i></i></th>
				<th style="width:10%;">达到条件<i></i></th>
				<th style="width:10%;">操作<i></i></th>
			</tr>
		</thead>
		<tbody>
		{loop $list $row}
		<tr>
			<td style="text-align:center;" >{$row['newid']}</td>	
			<td style="text-align:center;" >{$row['name']}</td>
			<td style="text-align:center;" >{$row['mobile']}</td>
			<td style="text-align:center;" >{$row['type']}</td>
			<td style="text-align:center;" >{$row['award']}</td>
			<td style="text-align:center;" >{php echo date("Y-m-d H:i:s" , $row['time'] );}</td>
			<td style="text-align:center;" >{$row['num']}</td>
			<td style="text-align:center;" >{if $row['status'] == 0}<a href="{php echo $this->createWebUrl('winners', array('id' => $rid, 'wid' => $row['newid'], 'status' => 1))}" class="text-success">发奖</a>{elseif $row['status'] == 1}<a href="{php echo $this->createWebUrl('winners', array('id' => $rid, 'wid' => $row['newid'], 'status' => 0))}" class="text-error">取消发奖</a>{/if}
		</tr>
		{/loop}
		</tbody>
		</table>
		<table class="table">
			<tr>
				<td>
					<input type="hidden" name="token" value="{$_W['token']}" />
				</td>
			</tr>
		</table>
	</div>
	</form>
	{$pager}
</div>
<script>
$(function() {
	//详细数据相关操作
	var tdIndex;
	$("#table-list thead").delegate("th", "mouseover", function(){
		if($(this).find("i").hasClass("")) {
			$("#table-list thead th").each(function() {
				if($(this).find("i").hasClass("icon-sort")) $(this).find("i").attr("class", "");
			});
			$("#table-list thead th").eq($(this).index()).find("i").addClass("icon-sort");
		}
	});
	$("#table-list thead th").click(function() {
		if($(this).find("i").length>0) {
			var a = $(this).find("i");
			if(a.hasClass("icon-sort") || a.hasClass("icon-caret-up")) { //递减排序
				/*
					数据处理代码位置
				*/
				$("#table-list thead th i").attr("class", "");
				a.addClass("icon-caret-down");
			} else if(a.hasClass("icon-caret-down")) { //递增排序
				/*
					数据处理代码位置
				*/
				$("#table-list thead th i").attr("class", "");
				a.addClass("icon-caret-up");
			}
			$("#table-list thead th,#table-list tbody:eq(0) td").removeClass("row-hover");
			$(this).addClass("row-hover");
			tdIndex = $(this).index();
			$("#table-list tbody:eq(0) tr").each(function() {
				$(this).find("td").eq(tdIndex).addClass("row-hover");
			});
		}
	});
});
</script>
{template 'common/footer'}